import { defineStore } from "pinia"

export const useGlobalStore = defineStore({
  id: "global",
  // 修改默认值之后，需清除 localStorage 数据
  state: () => {
    return {
      theme: 'light'
    }
  },
  getters: {
    getTheme: (state) => state.theme
  },
  actions: {
    changeTheme(val: string) {
      this.theme = val
    }
  },
  persist: true
})
